package com.example.chapter09;

import java.sql.*;

public class DBBean {
    private static final String url = "jdbc:mysql://localhost:3306/your_database_name?useSSL=false&serverTimezone=UTC";
    private static final String username = "your_username";
    private static final String password = "your_password";

    public static Connection getConnection() throws SQLException {
        return DriverManager.getConnection(url, username, password);
    }

    public static void close(PreparedStatement ps, Connection con) {
        try {
            if (ps!= null) {
                ps.close();
            }
            if (con!= null) {
                con.close();
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    public static void close(ResultSet rs, PreparedStatement ps, Connection con) {
    }
}